#include <avr/io.h>
#include "EmerButton.h"
#include "bool.h"
#include "simpleEventHandler.h"
#include "PMARData.h"

 
//*****************************************************
//						Emer_Button
//*****************************************************
void Emer_Button(void){
unsigned char EmerPB;
EmerPB =(~(PINE >> 5))&0x01;
	if (EmerPB!=EButtonPreviousStatus)  {
		if ((EmerPB) && (!EButtonPreviousStatus)) { // rise front
			SEQ_AddEvent(Emergenza_ENB);
		}
		if ((!EmerPB) && (EButtonPreviousStatus)) { // fall front
			SEQ_AddEvent(Emergenza_DIS);
		}
	}
EButtonPreviousStatus=(unsigned char)EmerPB;	
}	
	
